
import Home from './views/Home.vue'
import Doc from './views/Doc.vue'
import Button from './components/ButtonDemo.vue'
import Switch from './components/SwitchDemo.vue'
import Dialog from './components/DialogDemo.vue'
import Tab from './components/TabDemo.vue'
import Intro from './views/Intro.vue'
import GetStarted from './views/GetStarted.vue'
import Install from './views/Install.vue'

import { createWebHashHistory, createRouter } from 'vue-router'
const history = createWebHashHistory();
export const router = createRouter({
    history: history,
    routes: [//这里是routes 不是routers
        { path: '/', component: Home },
        {
            path: '/doc',
            component: Doc,
            children: [
                { path: 'intro', component: Intro },
                { path: 'install', component: Install },
                { path: 'getStart', component: GetStarted },
                { path: 'button', component: Button },
                { path: 'switch', component: Switch },
                { path: 'dialog', component: Dialog },
                { path: 'tab', component: Tab }]
        }
    ]
})
router.afterEach(() => {
    console.log('路由切换了')
})